package cn.itcast.myapplication.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;

import cn.itcast.myapplication.R;

public class HomePageActivity extends AppCompatActivity implements View.OnClickListener{

     private Button button1;

     private Button button2;

     private Button button3;

     private Button button4;

     private Button button5;

     private Button button6;

     private Button button7;

     private Button button8;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home_page);

        button1=(Button)findViewById(R.id.button1);
        button2=(Button)findViewById(R.id.button2);
        button3=(Button)findViewById(R.id.button3);
        button4=(Button)findViewById(R.id.button4);
        button5=(Button)findViewById(R.id.button5);
        button6=(Button)findViewById(R.id.button6);
        button7=(Button)findViewById(R.id.button7);
        button8=(Button)findViewById(R.id.button8);

        button1.setOnClickListener(this);
        button2.setOnClickListener(this);
        button3.setOnClickListener(this);
        button4.setOnClickListener(this);
        button5.setOnClickListener(this);
        button6.setOnClickListener(this);
        button7.setOnClickListener(this);
        button8.setOnClickListener(this);



    }


    @Override
    public void onClick(View view) {

        switch (view.getId()){

            case R.id.button1:

                Intent button1=new Intent(HomePageActivity.this, MainActivity.class);

                startActivity(button1);

                break;

            case R.id.button2:

                Intent button2=new Intent(HomePageActivity.this,MyLiveData.class);

                startActivity(button2);

                break;

            case R.id.button3:

                Intent button3=new Intent(HomePageActivity.this, MyDataBinding.class);

                startActivity(button3);

                break;

            case R.id.button4:

                Intent button4=new Intent(HomePageActivity.this,ViewModelRestore.class);

                startActivity(button4);

                break;

            case R.id.button5:

                Intent button5=new Intent(HomePageActivity.this,RoomActivity.class);

                startActivity(button5);

                break;

            case R.id.button6:

                Intent button6=new Intent(HomePageActivity.this,NavigationDemo.class);

                startActivity(button6);

                break;

            case R.id.button7:

                Intent button7=new Intent(HomePageActivity.this,NavViewModelDemo.class);

                startActivity(button7);

                break;

            case R.id.button8:

                Intent button8=new Intent(HomePageActivity.this,HomePage1Activity.class);

                startActivity(button8);


            }
        }
    }